package org.example.reemploymentsys.repository;

import org.example.reemploymentsys.entity.Exam;
import org.example.reemploymentsys.entity.ExamRecord;
import org.example.reemploymentsys.entity.Organization;
import org.example.reemploymentsys.entity.Student;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

public interface ExamRecordRe extends JpaRepository<ExamRecord, Long>, JpaSpecificationExecutor<ExamRecord> {
    Page<ExamRecord> findAllByStudentOrExam(Student student, Exam exam, PageRequest pageRequest);

    Page<ExamRecord> findAllByStudent_Organization(Organization organization, PageRequest pageRequest);
    List<ExamRecord> findAllByStudent_Organization(Organization organization);
}
